Image processing method and device, mobile terminal, and storage medium

ABSTRACT

Provided are an image processing method and device, a mobile terminal, and a storage medium. The method includes: acquiring a first image output by an image sensor; responsive to that a first signal value of the first image after being processed exceeds a saturation value of a first bit width at a preset image processing stage, recording the first signal value of the processed first image as a second signal value with a second bit width, the second bit width being greater than the first bit width; and mapping the second signal value recorded with the second bit width to a third signal value recorded with the first bit width to obtain a second image. Through the method, an operation of increasing a bit width can be used to retain more information of an image and improve the quality of the image, and an implementation is simple and effective.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based upon and claims priority to Chinese PatentApplication No. 202010243546.5, filed on Mar. 31, 2020, the entirecontents of which are incorporated herein by reference.

TECHNICAL FIELD

The present disclosure generally relates to the technical field of imageprocessing, and more particularly, to an image processing method anddevice, a mobile terminal, and a storage medium.

BACKGROUND

In the field of computer vision and pattern recognition, the highlightof an image brings difficulties and challenges to implementation effectsof many applications. Highlight is actually a very common phenomenon inreal scenes, which is the change of the color and brightness of anobject surface caused by the change of illumination at different viewingangles and reflects the optical reflection characteristics of the objectsurface. In digital images, highlight each pixel often have highbrightness, and thus cover the color, contour or texture of the objectsurface. Saturated highlight directly leads to the loss of local areainformation, so highlight is usually regarded as a defect in the image.

SUMMARY

The present disclosure provides an image processing method and device, amobile terminal, and a storage medium.

According to a first aspect of the present disclosure, an imageprocessing method is provided. The method may be applied to a mobileterminal, and may include: acquiring a first image output by an imagesensor; responsive to that a first signal value of the first image afterbeing processed exceeds a saturation value of a first bit width at apreset image processing stage, recording the first signal value of theprocessed first image as a second signal value with a second bit width,the second bit width being greater than the first bit width; and mappingthe signal value recorded with the second bit width to a third signalvalue recorded with the first bit width to obtain a second image.

According to a second aspect of the present disclosure, an imagecollection device is provided. The device may be applied to a mobileterminal, and may include a processor and a memory configured to storeinstructions executable by the processor. The processor is configured toacquire a first image output by an image sensor; responsive to that afirst signal value of the first image after being processed exceeds asaturation value of a first bit width at a preset image processingstage, record the first signal value of the processed first image as asecond signal value with a second bit width, the second bit width beinggreater than the first bit width; and map the signal value recorded withthe second bit width to a third signal value recorded with the first bitwidth to obtain a second image.

According to a third aspect of the present disclosure, a non-transitorycomputer-readable storage medium is provided. When instructions in thestorage medium are executed by a processor of a mobile terminal, themobile terminal can be caused to implement the image processing methodas described in the first aspect.

It is to be understood that the above general descriptions and detaileddescriptions below are only exemplary and explanatory and not intendedto limit the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, illustrate embodiments consistent with thepresent disclosure and, together with the specification, serve toexplain the principles of the present disclosure.

FIG. 1 is a flowchart showing an image processing method according to anembodiment of the present disclosure.

FIG. 2 is a first example diagram of a mapping relationship in anembodiment of the present disclosure.

FIG. 3 is a second example diagram of a mapping relationship in anembodiment of the present disclosure.

FIG. 4 is a diagram illustrating an image processing device according toan exemplary embodiment.

FIG. 5 is a block diagram illustrating a mobile terminal according to anembodiment of the present disclosure.

DETAILED DESCRIPTION

Reference will now be made in detail to exemplary embodiments, examplesof which are illustrated in the accompanying drawings. The followingdescription refers to the accompanying drawings in which the samenumbers in different drawings represent the same or similar elementsunless otherwise represented. The implementations set forth in thefollowing description of exemplary embodiments do not represent allimplementations consistent with the present disclosure. Instead, theyare merely examples of devices and methods consistent with aspectsrelated to the present disclosure as recited in the appended claims.

FIG. 1 is a flowchart showing an image processing method according to anembodiment of the present disclosure. As shown in FIG. 1 , an imageprocessing method applied to a mobile terminal includes the followingoperations.

In S11, a first image output by an image sensor is acquired. The firstimage may include first image signal values with a first bit width. Thefirst image signal values may be raw image signals.

In S12, responsive to that a first signal value of the first image afterbeing processed exceeds a saturation value of a first bit width at apreset image processing stage, the first signal value of the processedfirst image is recorded as a second signal value with a second bitwidth. The second bit width is greater than the first bit width.

In S13, the second signal value recorded with the second bit width ismapped to a third signal value recorded with the first bit width toobtain a second image.

In the embodiments of the present disclosure, the mobile terminal can bea mobile phone, a tablet computer, a camera, a smart wearable device, orthe like. The mobile terminal may include an image collection module,such as a front camera or a rear camera in a mobile phone, which mayperform image collection.

In operation S11, the first image is an image output by a sensor. Forexample, the first image may be an image output by a sensor in the imagecollection module. During the output, the sensor has a fixed bit width,which may be understood as a first bit width, such as 8 bits. Asupported dynamic range is 0 to 255. Due to the limitation of a dynamicrange of the sensor itself, a brightness value exceeding the dynamicrange may be truncated to a saturation value of 255.

Generally, the image output by the sensor needs to be subjected topreset image processing. The preset image processing is also calledImage Signal Processing (ISP). The ISP can complete the effectprocessing of digital images through a series of digital imageprocessing algorithms, including black level correction, white balancecorrection, lens shading correction, demosaicing, color spaceconversion, denoising, global tone mapping, local tone mapping,brightening, sharpening, and other operations. Due to the limitation ofa data bit width, a signal that is not saturated at the output of theimage sensor may also exceed the saturation value after the ISP.

The lens shading correction is taken as an example. When the lensshading correction is performed, the center of an image is taken as anorigin, a distance between each pixel and the center of the image istaken as a radius, and the pixel is multiplied by a corresponding gainto offset the uneven brightness caused by the optical characteristics ofa lens. The gain value of the center of the image is 1, and the gainvalues of other positions are greater than 1. Based on the introductionof a gain in the lens shading correction, the unsaturated signal mayexceed the saturation value after correction processing.

The white balance correction is taken as an example. In the whitebalance correction, a green channel is taken as a reference, and a redchannel and a blue channel may be multiplied by corresponding gains toachieve uniform brightness of the three color channels. The gain of thegreen channel is 1, and the gains of the red channel and the bluechannel are greater than 1. It can be seen that, based on theintroduction of a gain in the white balance correction, the unsaturatedsignal may exceed the saturation value after correction processing.

In this regard, in operation S12 of the present disclosure, when thesignal value of the processed first image exceeds the saturation valueof the first bit width, the signal value of the processed first imagemay be recorded with a second bit width that is greater than the firstbit width. That is, when image processing is performed on the firstimage, if the signal value exceeds the saturation value of the first bitwidth, truncation processing may be not performed, but the bit width maybe increased to the second bit width for output to retain a truncatedsignal.

For example, the first bit width may be 8 bits, the second bit width maybe 9 bits, and the supported dynamic range can be 0 to 511. After imageprocessing is performed on the first image, if the signal value exceeds255, the second bit width may be used for recording. It should be notedthat the second bit width is not limited to 9 bits, and the appropriatesecond bit width may be formulated according to a data storage capacityof the mobile terminal itself, so that signals exceeding the saturationvalue of the first bit width may be recorded without truncation.

In an embodiment, the image processing may include at least one of:

lens shading correction; and

white balance correction.

In this embodiment, as described above, due to image processing modessuch as lens shading correction and white balance correction, theunsaturated signal may exceed the saturation value after correctionprocessing. However, it should be noted that the image processing modesin which the unsaturated signal exceeds the saturation value due toimage processing are not limited to lens shading correction and whitebalance correction, and include, for example, brightness increasingprocessing and the like.

It should be noted that, generally, a larger signal value of an imageindicates larger brightness, and a large-brightness area is called ahighlight area or a high-brightness area. Therefore, a part of thesignal value of the first image after image processing, which exceedsthe saturation value of the first bit width, also belongs to thehighlight area. The highlight area part is likely to lose originaldetail information of an object (such as color, contour or texture), andthe saturation value of the highlight area directly loses local areainformation. Therefore, in the present disclosure, in order to retaininformation belonging to the highlight area, a part of the saturationvalue that exceeds the first bit width after image processing isrecorded with the second bit width.

However, considering the operations of subsequent processing modules,for example, the display of images in the mobile terminal, etc., thesignal value after being increased to the second bit width is needed tobe compressed to the original first bit width (that is, bit widthcompression). Therefore, in operation S13 of the embodiments of thepresent disclosure, the signal value recorded with the second bit widthmay be mapped to the signal value recorded with the first bit width toobtain a second image that retains the information of the highlight area(that is, highlight restoration).

There are two main technologies for performing highlight restoration onimages. The first technology is multi-frame processing. By controllingthe exposure time of different frames, different exposure images of thesame area can be acquired. For highlight areas under normal exposure(such as the sky and neon lights), highlight recovery can be achieved byfusing color and detail information of corresponding areas underunderexposure conditions (such as underexposure thumbnail images). Thesecond technology is single-frame processing. Intrinsic imagedecomposition may be performed on a light reflective area by estimatinga light reflection model of the highlight area, and diffuse reflectioncomponents and intrinsic reflection information may be separated byintegrating local area features to achieve the purpose of repairing thehighlight area.

However, with respect to the first solution, first, since the referenceis an underexposed thumbnail, the thumbnail needs to be interpolated tohave the same size as a normally exposed image. However, theinterpolation process may bring errors, which may further causeinformation recovery errors, thereby affecting the recovery effect ofthe highlight area. Second, the processing of multi-frame images mayhave a problem of image alignment. Without image alignment, the globalposition of two frames of images may be offset, and if there are movingobjects in the images, local alignment cannot be guaranteed. Third,since the mobile terminal needs to collect multiple frames of images andprocess the multiple frames of images, the data processing load of themobile terminal may be relatively heavy, making the mobile terminalconsume more power.

In addition, with respect to the second solution, since the lightreflection model only deals with a phenomenon of an image that smoothobjects reflects light, all the highlight areas, such as the sky andneon lights, cannot be processed, so the restoration effect is limited.

In the present disclosure, at an image processing stage, informationthat may be lost can be recorded with a simple operation of increasing abit width, and the original first bit width can be mapped back forsubsequent operations while more information is retained. On the onehand, there is no need for a mobile terminal to collect multiple framesof images and perform processing based on the multiple frames of images,thus lowering the power consumption of the mobile terminal and reducingthe occurrence of bad restoration effect caused by alignment processingor interpolation processing on the multiple frames of images. On theother hand, a mode of increasing a bit width is not limited by an imagescene. Compared with a mode of using a light reflection model to performintrinsic image decomposition, the solutions of the present disclosureare more universal.

In an embodiment, operation S12 may include that:

the signal value recorded with the second bit width is mapped to thesignal value recorded with the first bit width according to a maximumsignal value of different color components of each pixel of an imagerecorded with the first bit width after image processing to obtain athird image;

different color sub-signal values of each pixel recorded with the secondbit width are mapped to the signal value recorded with the first bitwidth based on the first image before image processing to obtain afourth image; and

the second image is obtained based on the third image and the fourthimage.

In this embodiment, mapping may be performed according to the maximumsignal value of different color components of each pixel of the imagerecorded with the first bit width after image processing. Since amaximum signal value of different color components reflects thebrightness of images, for example, in an HSV space, a value (V) of animage refers to a maximum value of red pixels (R), green pixels (G), andblue pixels (B) in the image, it can be understood that when mapping isperformed according to the maximum signal value of different colorcomponents of each pixel of the image recorded with the first bit widthafter image processing, the recovery of brightness during imagecorrection can be achieved. The restoration of brightness may reflectthe contour and/or texture of the image, so detailed information may berestored based on the recovery of brightness.

In this embodiment, based on the first image before image processing,different color sub-signal values of each pixel recorded with the secondbit width can be mapped to the signal value recorded with the first bitwidth. The first image is an image output by the sensor, that is, acollected original image. For example, a three-channel ratio value thathas not reached the saturation value in the collected original image cantruly reflect a color, so the color can be restored based on the firstimage.

According to the third image that recovers the details and the fourthimage that restores the color, the second image that recovers both thedetails and the color may be obtained, so the quality of the obtainedimage is better.

In an embodiment, both the third image and the fourth image may beimages of an RGB space. The operation that the second image is obtainedbased on the third image and the fourth image may include that:

the third image is converted to an HSV space to obtain a first HSV spaceimage;

the fourth image is converted to the HSV space to obtain a second HSVspace image; and

corresponding values in the RGB space are acquired according to a valueof a value V channel in the first HSV space image, and a value of a hueH channel and a value of a saturation S channel in the second HSV spaceimage, and the second image is obtained.

In this embodiment, in order to obtain the second image that recoversboth the details and the color, brightness information of the thirdimage and color-related information in the fourth image are used. In theHSV space, the value of the value (V) channel reflects brightness, sothe third image is converted to the first HSV space to obtain the valueof the V channel. Hue (H) in the HSV space reflects hue, and saturation(S) reflects the saturation of a color in a hue space, which is theinformation of the reflected color, so the fourth image is converted tothe second HSV space to obtain the values of the H channel and the Vchannel.

According to the value of the V channel obtained from the third image,the values of the H channel and the S channel obtained from the fourthimage may be inversely transformed into the RGB space to obtain a secondimage with both brightness and color restored.

It can be understood that, in this embodiment, based on the recovery ofthe brightness and the restoration of the color separately, a full rangeof recovery can be achieved.

In an embodiment, the operation that the signal value recorded with thesecond bit width is mapped to the signal value recorded with the firstbit width according to a maximum signal value of different colorcomponents of each pixel of an image recorded with the first bit widthafter image processing to obtain a third image may include that:

a first part, greater than a preset threshold, of the maximum signalvalue of different color components of each pixel recorded with thesecond bit width is mapped to a range between the preset threshold andthe saturation value of the first bit width; and

a second part, less than or equal to the preset threshold, of themaximum signal value of different color components of each pixelrecorded with the second bit width is mapped to match with a part, lessthan or equal to the preset threshold, of the maximum signal value ofdifferent color components of each pixel of the image recorded with thefirst bit width after image processing to obtain the third image.

In this embodiment, after image processing is performed on the firstimage, the image recorded with the first bit width refers to an imageafter a signal exceeding the saturation value of the first bit width istruncated with the saturation value of the first bit width, for example,recorded as SrcC. When the signal value of the processed first imageexceeds the saturation value of the first bit width, the image recordedwith the second bit width is recorded as SrcU.

In the present disclosure, when mapping is performed according to theimage recorded with the first bit width after image processing, it canbe understood that, in a part less than or equal to the saturation valueof the first bit width, different color component signal values of theeach pixel of SrcC and SrcU are consistent, and differ only in a partgreater than the saturation value of the first bit width. Therefore,when mapping is performed on the basis of the maximum signal value ofdifferent color components of each pixel to obtain abrightness-recovered third image, before the mapping, in the part lessthan or equal to the saturation value of the first bit width, themaximum signal value of different color components of each pixel isconsistent, while the maximum signal value of different color componentsof each pixel is different in the part greater than the saturation valueof the first bit width.

For example, the first bit width may be 8 bits and the second bit widthmay be 9 bits. FIG. 2 is a first example diagram of a mappingrelationship in an embodiment of the present disclosure. As shown inFIG. 2 , the ordinate represents a maximum value of different colorcomponents of each pixel point of SrcC, and the abscissa represents amaximum value of different color components of each pixel point of SrcU.In FIG. 2 , before the mapping processing of SrcU in the presentdisclosure is performed, a curve of a mapping relationship between SrcUand SrcC is recorded as L1. As can be seen from FIG. 2 , in a part lessthan or equal to 255, the maximum value of different color components ofeach pixel point of SrcC is consistent, the mapping relationship islinear, and the slope is 1. For SrcC, since the part that exceeds thesaturation value is truncated by 255, the mapping relationship isexpressed as a straight line with a value of 255 in a part with themaximum value of different color components of each pixel point of SrcUexceeding 255.

In the present disclosure, in order to recover the detailed informationof the highlighted area, L1 needs to be modified. In this regard, abrightness threshold Thresh to be recovered is set in the presentdisclosure, that is, a preset threshold. The preset threshold representsthe set brightness area that needs to be recovered. For example, if theThresh value is 240, the set highlight area to be recovered is 241 to255, so that a part exceeding 240 of the maximum signal value ofdifferent color components of each pixel recorded with the second bitwidth may be mapped to a range between 241 and 255.

Exemplarily, as shown in FIG. 2 , L2 is an example curve of mapping. InL2, the part (second part) less than or equal to the preset threshold(240) of the maximum signal value of different color components of eachpixel of SrcU is consistent with the part less than or equal to 240 ofthe maximum signal value of different color components of each pixel ofSrcC. The part (first part) greater than 240 of the maximum signal valueof different color components of each pixel of SrcU is mapped to a rangebetween 241 and 255, and the slope of the brightness mapping curve ofthis part is tan((255−Thresh)/(511−Thresh)).

It should be noted that when the first part, greater than the presetthreshold, of the maximum signal value of different color components ofeach pixel recorded with the second bit width is mapped to a rangebetween the preset threshold and the saturation value of the first bitwidth, the slope of the mapping curve is not limited to: a ratio betweenthe value of the saturation value of the first bit width minus thepreset threshold and the value of the saturation value of the second bitwidth minus the preset threshold. For example, a non-linear mapping modemay also be used. However, it can be understood that, by adopting theslope linear mapping mode, the gradient of the brightness value recordedwith the second bit width can be used to maintain the recovery of thebrightness gradient, thereby making the brightness recovery effect morerealistic.

It can be understood that when the signal value recorded with the secondbit width is mapped to the signal value recorded with the first bitwidth according to a maximum signal value of different color componentsof each pixel of an image recorded with the first bit width after imageprocessing to obtain a third image, the above mode of the presentdisclosure is adopted. On the one hand, the second part is keptconsistent with the first image, and it can be ensured that theoperation of mapping from the second bit width to the first bit width(bit width compression) cannot change the brightness of the processedimage. On the other hand, the brightness recovery of the highlight areais more controllable and smarter based on the control of the presetthreshold.

In an embodiment, the method may further include that:

a smooth-curve-shape mapping relationship is obtained based on themapping of the first part between the preset threshold and thesaturation value of the first bit width and the mapping of the secondpart to the part, less than or equal to the preset threshold, of themaximum signal value of different color components of each pixel of theimage recorded with the first bit width after image processing.

The operation that the signal value recorded with the second bit widthis mapped to the signal value recorded with the first bit widthaccording to a maximum signal value of different color components ofeach pixel of an image recorded with the first bit width after imageprocessing to obtain a third image may include that:

a maximum signal value of different color components of each pixelrecorded with the second bit width is mapped to the signal valuerecorded with the first bit width according to the smooth-curve-shapemapping relationship to obtain the third image.

In this embodiment, in order to avoid the phenomenon that the changedbrightness mapping curve causes an unnatural transition in the image,fitting may be performed based on the mapping of the first part and themapping of the second part to obtain a smooth-curve-shape mappingrelationship. For example, the fitting mode may use polynomial fitting,least square fitting, etc. The embodiments of the present disclosure donot limit the fitting method for obtaining the smooth-curve-shapemapping relationship.

In the present disclosure, after performing fitting, a maximum signalvalue of different color components of each pixel recorded with thesecond bit width may be mapped to the signal value recorded with thefirst bit width according to the fitted smooth-curve-shape mappingrelationship to obtain a third image that is excessively natural afterbrightness recovery.

In an embodiment, the operation that different color sub-signal valuesof each pixel recorded with the second bit width are mapped to thesignal value recorded with the first bit width based on the first imagebefore image processing to obtain a fourth image may include that:

a first pixel having different color sub-signal values all less than thesaturation value of the first bit width is determined among each pixelof the first image;

a second pixel corresponding to the first pixel is determined among eachpixel recorded with the second bit width;

a third part having a color sub-signal value greater than the saturationvalue of the first bit width is determined from the second pixel; and

different color sub-signal values of each pixel recorded with the secondbit width are mapped to the signal value recorded with the first bitwidth based on the third part to obtain the fourth image.

In this embodiment, the first image before image processing is an imageoriginally output by the image sensor. As mentioned above, in thesignals output by the image sensor, the three-channel ratio of an outputsignal that has not reached the saturation value can truly reflect thecolor, and when the signal output by the image sensor reachessaturation, the three-channel ratio of the output signal cannot reflectthe true color. Therefore, in the embodiments of the present disclosure,the first image (for example, recorded as SrcS) may be used to mapdifferent color sub-signal values of each pixel of the signal valuerecorded with the second bit width to the signal value recorded with thefirst bit width to obtain a color-recovered fourth image. An imagecorresponding to the signal value recorded with the second bit width isrecorded as SrcU, for example.

Specifically, a first pixel having different color sub-signal values allless than the saturation value of the first bit width can be firstdetermined among each pixel of the first image (SrcS). In thisoperation, different color sub-signal values of each pixel in SrcS maybe scanned point by point, and whether different color sub-signal valuesare all less than the saturation value of the first bit width (forexample, 255) can be determined.

For example, assuming that different color sub-signal values of eachpixel of the signal (SrcS) output by the image sensor are R0, G0, andB0, the maximum value of R0, G0, and B0 may be first acquired asmaxRGB0, and whether maxRGB0 is less than 255 may be determined.

Further, a second pixel corresponding to the first pixel needs to bedetermined among the pixels (SrcU) recorded with the second bit width,and a third part (belonging to the highlight area) having a colorsub-signal value greater than the saturation value of the first bitwidth needs to be determined from the second pixel to map, based on thethird part, different color sub-signal values of each pixel recordedwith the second bit width to the signal value recorded with the firstbit width to obtain a fourth image for recovering the color of thehighlight area.

For example, it is assumed that different color sub-signal values ofeach pixel point of the image (SrcU) that is subjected to imageprocessing and recorded with the second bit width are R, G, and B. Inthe second pixel corresponding to the first pixel, the maximum value ofR, G, and B may be first acquired as maxRGB, it may be determinedwhether maxRGB is greater than 255, and the second pixel having maxRGBgreater than 255 is recorded as the third part.

It can be understood that the first pixel may be determined from thepixels of the first image, the third part for color recovery may bedivided from the signal values recorded with the second bit widthaccording to the first pixel, and then different color sub-signal valuesof each pixel recorded with the second bit width may be mapped to thesignal value recorded with the first bit width based on the third partto obtain a color-recovered fourth image. The accuracy of color recoverycan be improved.

It should be noted that when bit width compression mapping is performedbased on the third part, the pixels belonging to the third part and thepixels other than the third part among the pixels recorded with thesecond bit width need to be mapped in different ways.

In an embodiment, the operation that different color sub-signal valuesof each pixel recorded with the second bit width are mapped to thesignal value recorded with the first bit width based on the third partto obtain the fourth image may include that:

different color sub-signal values of each pixel of the third part arecompressed proportionally to a range not exceeding the saturation valueof the first bit width; and

color sub-signal values of pixels, other than the third part, recordedwith the second bit width, which are greater than a color sub-signalvalue of the saturation value of the first bit width, are mapped to thesaturation value of the first bit width to obtain the fourth image.

In this embodiment, since the third part belongs to a part capable ofcolor recovery, different color sub-signal values of each pixel of thethird part may be compressed proportionally to a range not exceeding thesaturation value of the first bit width to retain the true color.Exemplarily, when the third part is compressed proportionally by color,the code is as follows:

if maxRGB0<Sat

if maxRGB>Satd=Sat/maxRGB;R=R*(1−a)+R*d*a;G=G*(1−a)+G*d*a;B=B*(1−a)+B*d*a;

In this part, Sat is the saturation value of the first bit width, d anda are compression coefficients, the value of d is less than 1, and thevalue of a is less than or equal to 1. d is the ratio of the saturationvalue of the first bit width to the maximum value of a current pixel inthe third part, and a may be an S-shaped mapping curve. By means of theabove mapping, different color sub-signal values of each pixel of thethird part can be compressed proportionally to a range not exceeding thesaturation value of the first bit width.

FIG. 3 is a second example diagram of a mapping relationship in anembodiment of the present disclosure. The mapping relationship diagramis a value mapping diagram of a. As shown in FIG. 3 , the ordinate isthe value of a, the abscissa diff refers to a difference between thesaturation value (Sat) of the first bit width and the maximum valuemaxRGB0 of different color sub-signal values of each pixel point of thefirst image, the value of a is related to the value of diff, and thevalue of a changes dynamically.

It can be understood that, when the proportional compression mapping isperformed for different color sub-signal values of each pixel of thethird part, the above dynamic proportional compression mode according tothe present pixel situation can improve the accuracy of color recoveryof the highlight area. In addition, in this embodiment, color sub-signalvalues, greater than the saturation value of the first bit width, indifferent color sub-signal values of each of the pixels other than thethird part can be directly mapped to the saturation value of the firstbit width. The mapping mode is also relatively simple.

It should be noted that, in this embodiment, color sub-signal values,less than or equal to the saturation value of the first bit width, indifferent color sub-signal values of each of the pixels other than thethird part may be kept unchanged.

FIG. 4 is a diagram illustrating an image processing device according toan exemplary embodiment. Referring to FIG. 4 , the image collectiondevice includes:

an acquisition module 101, configured to acquire a first image output byan image sensor;

a bit width increasing module 102, configured to, responsive to that asignal value of the first image after being processed exceeds asaturation value of a first bit width at a preset image processingstage, record the signal value of the processed first image with asecond bit width, the second bit width being greater than the first bitwidth; and

a mapping module 103, configured to map the signal value recorded withthe second bit width to a signal value recorded with the first bit widthto obtain a second image.

Optionally, the mapping module 103 may include a first mapping module103A, a second mapping module 103B, and an obtaining module 103C.

The first mapping module 103A is configured to, according to a maximumsignal value of different color components of each pixel of an imagerecorded with the first bit width after image processing, map the signalvalue recorded with the second bit width to the signal value recordedwith the first bit width to obtain a third image.

The second mapping module 103B is configured to, based on the firstimage before image processing, map different color sub-signal values ofeach pixel recorded with the second bit width to the signal valuerecorded with the first bit width to obtain a fourth image.

The obtaining module 103C is configured to obtain the second image basedon the third image and the fourth image.

Optionally, the first mapping module 102A is specifically configured tomap a first part, greater than a preset threshold, of the maximum signalvalue of different color components of each pixel recorded with thesecond bit width between the preset threshold and the saturation valueof the first bit width; and map a second part, less than or equal to thepreset threshold, of the maximum signal value of different colorcomponents of each pixel recorded with the second bit width to matchwith a part, less than or equal to the preset threshold, of the maximumsignal value of different color components of each pixel of the imagerecorded with the first bit width after image processing to obtain thethird image.

Optionally, the device may further include:

a smoothing module 104, configured to obtain a smooth-curve-shapemapping relationship based on the mapping of the first part between thepreset threshold and the saturation value of the first bit width and themapping of the second part to the part, less than or equal to the presetthreshold, of the maximum signal value of different color components ofeach pixel of the image recorded with the first bit width after imageprocessing.

The first mapping module 103A is specifically configured to, accordingto the smooth-curve-shape mapping relationship, map a maximum signalvalue of different color components of each pixel recorded with thesecond bit width to the signal value recorded with the first bit widthto obtain the third image.

Optionally, the second mapping module 103B is specifically configured todetermine, among each pixel of the first image, a first pixel havingdifferent color sub-signal values all less than the saturation value ofthe first bit width; determine, among each pixel recorded with thesecond bit width, a second pixel corresponding to the first pixel;determine, from the second pixel, a third part having a color sub-signalvalue greater than the saturation value of the first bit width; and map,based on the third part, different color sub-signal values of each pixelrecorded with the second bit width to the signal value recorded with thefirst bit width to obtain the fourth image.

Optionally, the second mapping module 103B is specifically configured toproportionally compress different color sub-signal values of each pixelof the third part to a range not exceeding the saturation value of thefirst bit width; and map color sub-signal values of pixels, other thanthe third part, recorded with the second bit width, which are greaterthan a color sub-signal value of the saturation value of the first bitwidth, to the saturation value of the first bit width to obtain thefourth image.

Optionally, the obtaining module 103C is specifically configured toconvert the third image to an HSV space to obtain a first HSV spaceimage; convert the fourth image to the HSV space to obtain a second HSVspace image; and acquire corresponding values in the RGB space accordingto a value of a value V channel in the first HSV space image, and avalue of a hue H channel and a value of a saturation S channel in thesecond HSV space image, and obtain the second image.

Optionally, the image processing may include at least one of:

lens shading correction; and

white balance correction.

With respect to the devices in the above embodiments, the specificmanners for performing operations for individual modules therein havebeen described in detail in the embodiments regarding the methods, whichwill not be elaborated herein.

FIG. 5 is a block diagram illustrating a mobile terminal device 800according to an exemplary embodiment. For example, the device 800 may bea mobile phone, a camera, etc.

Referring to FIG. 5 , the device 800 may include one or more of thefollowing components: a processing component 802, a memory 804, a powercomponent 806, a multimedia component 808, an audio component 810, anInput/Output (I/O) interface 812, a sensor component 814, and acommunication component 816.

The processing component 802 typically controls overall operations ofthe device 800, such as operations associated with display, telephonecalls, data communications, camera operations, and recording operations.The processing component 802 may include one or more processors 820 forexecuting instructions to complete all or part of the operations in thedescribed methods. Moreover, the processing component 802 may includeone or more modules which facilitate the interaction between theprocessing component 802 and other components. For example, theprocessing component 802 may include a multimedia module to facilitatethe interaction between the multimedia component 808 and the processingcomponent 802.

The memory 804 is configured to store various types of data to supportoperations at the device 800. Examples of such data include instructionsfor any applications or methods operated on the device 800, contactdata, phonebook data, messages, pictures, video, etc. The memory 804 maybe implemented using any type of volatile or non-volatile memorydevices, or a combination thereof, such as a Static Random Access Memory(SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM),an Erasable Programmable Read-Only Memory (EPROM), a ProgrammableRead-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic memory, aflash memory, a magnetic disk or an optical disk.

The power component 806 provides power to various components of thedevice 800. The power component 806 may include: a power managementsystem, one or more power sources, and any other components associatedwith the generation, management and distribution of power in the device800.

The multimedia component 808 includes a screen providing an outputinterface between the device 800 and the user. In some embodiments, thescreen may include a Liquid Crystal Display (LCD) and a Touch Panel(TP). If the screen includes the TP, the screen may be implemented as atouch screen to receive an input signal from the user. The TP includesone or more touch sensors to sense touches, swipes and gestures on theTP. The touch sensors may not only sense a boundary of a touch or swipeaction but also detect a duration and pressure associated with the touchor swipe action. In some embodiments, the multimedia component 808includes a front camera and/or a rear camera. The front camera and/orthe rear camera may receive an external multimedia datum while thedevice 800 is in an operation mode, such as a photographing mode or avideo mode. Each of the front camera and the rear camera may be a fixedoptical lens system or may have focusing and optical zoomingcapabilities.

The audio component 810 is configured to output and/or input audiosignals. For example, the audio component 810 includes a Microphone(MIC) configured to receive an external audio signal when the device 800is in an operation mode, such as a call mode, a recording mode, and avoice recognition mode. The received audio signal may be further storedin the memory 804 or transmitted via the communication component 816. Insome embodiments, the audio component 810 further includes a speaker foroutputting the audio signal.

The I/O interface 812 provides an interface between the processingcomponent 802 and peripheral interface modules, such as a keyboard, aclick wheel, or buttons. The buttons may include, but are not limitedto, a home button, a volume button, a starting button, and a lockingbutton.

The sensor component 814 includes one or more sensors to provide statusassessments of various aspects of the device 800. For example, thesensor component 814 may detect an open/closed status of the device 800,and relative positioning of components. For example, the component isthe display and the keypad of the device 800. The sensor component 814may also detect a change in position of the device 800 or a component ofthe device 800, a presence or absence of user contact with the device800, an orientation or an acceleration/deceleration of the device 800,and a change in temperature of the device 800. The sensor component 814may include a proximity sensor configured to detect the presence ofnearby objects without any physical contact. The sensor component 814may also include a light sensor, such as a Complementary Metal OxideSemiconductor (CMOS) or Charge Coupled Device (CCD) image sensor,configured for use in an imaging application. In some embodiments, thesensor component 814 may also include an acceleration sensor, agyroscope sensor, a magnetic sensor, a pressure sensor, or a temperaturesensor.

The communication component 816 is configured to facilitatecommunication, wired or wirelessly, between the device 800 and otherdevices. The device 800 may access a wireless network based on acommunication standard, such as Wi-Fi, 2G or 3G, or a combinationthereof. In one exemplary embodiment, the communication component 816receives a broadcast signal or broadcast associated information from anexternal broadcast management system via a broadcast channel. In anexemplary embodiment, the communication component 816 further includes aNear Field Communication (NFC) module to facilitate short-rangecommunications. For example, the NFC module may be implemented based ona Radio Frequency Identification (RFID) technology, an Infrared DataAssociation (IrDA) technology, an Ultra-Wideband (UWB) technology, aBluetooth (BT) technology, and other technologies.

In exemplary embodiments, the device 800 may be implemented with one ormore Application Specific Integrated Circuits (ASICs), Digital SignalProcessors (DSPs), Digital Signal Processing Devices (DSPDs),Programmable Logic Devices (PLDs), Field Programmable Gate Arrays(FPGAs), controllers, micro-controllers, microprocessors, or otherelectronic elements, for performing the above described methods.

In exemplary embodiments, there is also provided a non-transitorycomputer-readable storage medium including instructions, such asincluded in the memory 804, executable by the processor 820 of thedevice 800 to complete the above described method. For example, thenon-transitory computer-readable storage medium may be a ROM, a RandomAccess Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), amagnetic tape, a floppy disc, an optical data storage device and thelike.

A non-transitory computer-readable storage medium is provided. Wheninstructions in the storage medium are executed by a processor of amobile terminal, the mobile terminal is caused to perform a controlmethod. The method include:

acquiring a first image output by an image sensor;

responsive to that a signal value of the first image after beingprocessed exceeds a saturation value of a first bit width at a presetimage processing stage, recording the signal value of the processedfirst image with a second bit width, the second bit width being greaterthan the first bit width; and

mapping the signal value recorded with the second bit width to a signalvalue recorded with the first bit width to obtain a second image.

In the embodiments of the present disclosure, during image processing ofa first image output by a sensor, when a signal value of the first imageafter being processed exceeds a saturation value of a first bit width,the signal value of the first image may be recorded with a second bitwidth, that is, information that may be lost can be recorded with asimple bit width increasing operation, and the original first bit widthcan be mapped back for subsequent operations while more information isretained. On the one hand, there is no need for a mobile terminal tocollect multiple frames of images and perform processing based on themultiple frames of images to restore the information that may be lost,thus lowering the power consumption of the mobile terminal and reducingthe occurrence of bad restoration effect caused by alignment processingor interpolation processing on the multiple frames of images. On theother hand, a mode of increasing a bit width is not limited by an imagescene. Compared with a mode of performing intrinsic image decompositionwith a light reflection model for highlight repair, the solutions of thepresent disclosure are more universal.

It may further be understood that “a plurality of” in the presentdisclosure refers to more or more than two, and other quantifiers arethe same. The “and/or” is an association relationship for describingassociated objects and represents that three relationships may exist.For example, A and/or B may represent the following three cases: only Aexists, both A and B exist, and only B exists. The character “/”generally indicates that the related objects are in an “or”relationship. “A/an”, “said” and “the” in a singular form are alsointended to include a plural form, unless other meanings are clearlydenoted throughout the present disclosure.

It is further to be understood that, although terms “first”, “second”and the like may be adopted to describe various information, theinformation should not be limited to these terms. These terms are onlyadopted to distinguish the information of the same type rather thanrepresent a special sequence or an importance. As a matter of fact, theterms “first”, “second” and the like may be interchangeable completely.For example, without departing from the scope of the present disclosure,first information may also be called second information and, similarly,second information may also be called first information.

In the description of the present disclosure, the terms “oneembodiment,” “some embodiments,” “example,” “specific example,” or “someexamples,” and the like can indicate a specific feature described inconnection with the embodiment or example, a structure, a material orfeature included in at least one embodiment or example. In the presentdisclosure, the schematic representation of the above terms is notnecessarily directed to the same embodiment or example.

Moreover, the particular features, structures, materials, orcharacteristics described can be combined in a suitable manner in anyone or more embodiments or examples. In addition, various embodiments orexamples described in the specification, as well as features of variousembodiments or examples, can be combined and reorganized.

In some embodiments, the control and/or interface software or app can beprovided in a form of a non-transitory computer-readable storage mediumhaving instructions stored thereon is further provided. For example, thenon-transitory computer-readable storage medium can be a ROM, a CD-ROM,a magnetic tape, a floppy disk, optical data storage equipment, a flashdrive such as a USB drive or an SD card, and the like.

Implementations of the subject matter and the operations described inthis disclosure can be implemented in digital electronic circuitry, orin computer software, firmware, or hardware, including the structuresdisclosed herein and their structural equivalents, or in combinations ofone or more of them. Implementations of the subject matter described inthis disclosure can be implemented as one or more computer programs,i.e., one or more portions of computer program instructions, encoded onone or more computer storage medium for execution by, or to control theoperation of, data processing apparatus.

Alternatively, or in addition, the program instructions can be encodedon an artificially-generated propagated signal, e.g., amachine-generated electrical, optical, or electromagnetic signal, whichis generated to encode information for transmission to suitable receiverapparatus for execution by a data processing apparatus. A computerstorage medium can be, or be included in, a computer-readable storagedevice, a computer-readable storage substrate, a random or serial accessmemory array or device, or a combination of one or more of them.

Moreover, while a computer storage medium is not a propagated signal, acomputer storage medium can be a source or destination of computerprogram instructions encoded in an artificially-generated propagatedsignal. The computer storage medium can also be, or be included in, oneor more separate components or media (e.g., multiple CDs, disks, drives,or other storage devices). Accordingly, the computer storage medium canbe tangible.

The operations described in this disclosure can be implemented asoperations performed by a data processing apparatus on data stored onone or more computer-readable storage devices or received from othersources.

The devices in this disclosure can include special purpose logiccircuitry, e.g., an FPGA (field-programmable gate array), or an ASIC(application-specific integrated circuit). The device can also include,in addition to hardware, code that creates an execution environment forthe computer program in question, e.g., code that constitutes processorfirmware, a protocol stack, a database management system, an operatingsystem, a cross-platform runtime environment, a virtual machine, or acombination of one or more of them. The devices and executionenvironment can realize various different computing modelinfrastructures, such as web services, distributed computing, and gridcomputing infrastructures.

A computer program (also known as a program, software, softwareapplication, app, script, or code) can be written in any form ofprogramming language, including compiled or interpreted languages,declarative or procedural languages, and it can be deployed in any form,including as a stand-alone program or as a portion, component,subroutine, object, or other portion suitable for use in a computingenvironment. A computer program can, but need not, correspond to a filein a file system. A program can be stored in a portion of a file thatholds other programs or data (e.g., one or more scripts stored in amarkup language document), in a single file dedicated to the program inquestion, or in multiple coordinated files (e.g., files that store oneor more portions, sub-programs, or portions of code). A computer programcan be deployed to be executed on one computer or on multiple computersthat are located at one site or distributed across multiple sites andinterconnected by a communication network.

The processes and logic flows described in this disclosure can beperformed by one or more programmable processors executing one or morecomputer programs to perform actions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., an FPGA, or an ASIC.

Processors or processing circuits suitable for the execution of acomputer program include, by way of example, both general and specialpurpose microprocessors, and any one or more processors of any kind ofdigital computer. Generally, a processor will receive instructions anddata from a read-only memory, or a random-access memory, or both.Elements of a computer can include a processor configured to performactions in accordance with instructions and one or more memory devicesfor storing instructions and data.

Generally, a computer will also include, or be operatively coupled toreceive data from or transfer data to, or both, one or more mass storagedevices for storing data, e.g., magnetic, magneto-optical disks, oroptical disks. However, a computer need not have such devices. Moreover,a computer can be embedded in another device, e.g., a mobile telephone,a personal digital assistant (PDA), a mobile audio or video player, agame console, a Global Positioning System (GPS) receiver, or a portablestorage device (e.g., a universal serial bus (USB) flash drive), to namejust a few.

Devices suitable for storing computer program instructions and datainclude all forms of non-volatile memory, media and memory devices,including by way of example semiconductor memory devices, e.g., EPROM,EEPROM, and flash memory devices; magnetic disks, e.g., internal harddisks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROMdisks. The processor and the memory can be supplemented by, orincorporated in, special purpose logic circuitry.

To provide for interaction with a user, implementations of the subjectmatter described in this specification can be implemented with acomputer and/or a display device, e.g., a VR/AR device, a head-mountdisplay (HMD) device, a head-up display (HUD) device, smart eyewear(e.g., glasses), a CRT (cathode-ray tube), LCD (liquid-crystal display),OLED (organic light emitting diode), or any other monitor for displayinginformation to the user and a keyboard, a pointing device, e.g., amouse, trackball, etc., or a touch screen, touch pad, etc., by which theuser can provide input to the computer.

Implementations of the subject matter described in this specificationcan be implemented in a computing system that includes a back-endcomponent, e.g., as a data server, or that includes a middlewarecomponent, e.g., an application server, or that includes a front-endcomponent, e.g., a client computer having a graphical user interface ora Web browser through which a user can interact with an implementationof the subject matter described in this specification, or anycombination of one or more such back-end, middleware, or front-endcomponents.

The components of the system can be interconnected by any form or mediumof digital data communication, e.g., a communication network. Examplesof communication networks include a local area network (“LAN”) and awide area network (“WAN”), an inter-network (e.g., the Internet), andpeer-to-peer networks (e.g., ad hoc peer-to-peer networks).

While this specification contains many specific implementation details,these should not be construed as limitations on the scope of any claims,but rather as descriptions of features specific to particularimplementations. Certain features that are described in thisspecification in the context of separate implementations can also beimplemented in combination in a single implementation. Conversely,various features that are described in the context of a singleimplementation can also be implemented in multiple implementationsseparately or in any suitable subcombination.

Moreover, although features can be described above as acting in certaincombinations and even initially claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claimed combination can be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In certain circumstances, multitasking and parallel processingcan be advantageous. Moreover, the separation of various systemcomponents in the implementations described above should not beunderstood as requiring such separation in all implementations, and itshould be understood that the described program components and systemscan generally be integrated together in a single software product orpackaged into multiple software products.

As such, particular implementations of the subject matter have beendescribed. Other implementations are within the scope of the followingclaims. In some cases, the actions recited in the claims can beperformed in a different order and still achieve desirable results. Inaddition, the processes depicted in the accompanying figures do notnecessarily require the particular order shown, or sequential order, toachieve desirable results. In certain implementations, multitasking orparallel processing can be utilized.

Other embodiments of the present disclosure will be apparent to thoseskilled in the art from consideration of the specification and practiceof the present disclosure disclosed here. The present disclosure isintended to cover any variations, uses, or adaptations of the presentdisclosure following the general principles thereof and including suchdepartures from the present disclosure as come within known or customarypractice in the art. It is intended that the specification and examplesbe considered as exemplary only, with a true scope and spirit of thepresent disclosure being indicated by the following claims.

It will be appreciated that the present disclosure is not limited to theexact construction that has been described above and illustrated in theaccompanying drawings, and that various modifications and changes can bemade without departing from the scope thereof. It is intended that thescope of the present disclosure only be limited by the appended claims.

What is claimed is:
 1. A method for image processing, implemented by amobile terminal, the method comprising: acquiring a first image outputby an image sensor; responsive to that a first signal value of the firstimage after being processed exceeds a saturation value of a first bitwidth at a preset image processing stage, recording the first signalvalue of the processed first image as a second signal value with asecond bit width, wherein the second bit width is greater than the firstbit width; and mapping the second signal value recorded with the secondbit width to a third signal value recorded with the first bit width toobtain a second image, wherein mapping the second signal value recordedwith the second bit width to the third signal value recorded with thefirst bit width to obtain the second image comprises: mapping, accordingto a maximum signal value of different color components of each pixel ofan image recorded with the first bit width after image processing, thesecond signal value recorded with the second bit width to the thirdsignal value recorded with the first bit width to obtain a third image;mapping, based on the first image before image processing, differentcolor sub-signal values of each pixel recorded with the second bit widthto the third signal value recorded with the first bit width to obtain afourth image; and obtaining the second image based on the third imageand the fourth image.
 2. The method according to claim 1, wherein themapping, according to a maximum signal value of different colorcomponents of each pixel of an image recorded with the first bit widthafter image processing, the second signal value recorded with the secondbit width to the third signal value recorded with the first bit width toobtain a third image comprises: mapping a first part, greater than apreset threshold, of the maximum signal value of different colorcomponents of each pixel recorded with the second bit width to a rangebetween the preset threshold and the saturation value of the first bitwidth; and mapping a second part, less than or equal to the presetthreshold, of the maximum signal value of different color components ofeach pixel recorded with the second bit width to match with a part, lessthan or equal to the preset threshold, of the maximum signal value ofdifferent color components of each pixel of the image recorded with thefirst bit width after image processing to obtain the third image.
 3. Themethod according to claim 2, further comprising: obtaining asmooth-curve-shape mapping relationship based on the mapping of thefirst part to the range between the preset threshold and the saturationvalue of the first bit width and the mapping of the second part to thepart, less than or equal to the preset threshold, of the maximum signalvalue of different color components of each pixel of the image recordedwith the first bit width after image processing, wherein the mapping,according to a maximum signal value of different color components ofeach pixel of an image recorded with the first bit width after imageprocessing, the second signal value recorded with the second bit widthto the third signal value recorded with the first bit width to obtain athird image comprises: mapping, according to the smooth-curve-shapemapping relationship, the maximum signal value of different colorcomponents of each pixel recorded with the second bit width to the thirdsignal value recorded with the first bit width to obtain the thirdimage.
 4. The method according to claim 1, wherein the mapping, based onthe first image before image processing, different color sub-signalvalues of each pixel recorded with the second bit width to the thirdsignal value recorded with the first bit width to obtain a fourth imagecomprises: determining, among each pixel of the first image, a firstpixel having different color sub-signal values all less than thesaturation value of the first bit width; determining, among each pixelrecorded with the second bit width, a second pixel corresponding to thefirst pixel; determining, from the second pixel, a third part having acolor sub-signal value greater than the saturation value of the firstbit width; and mapping, based on the third part, different colorsub-signal values of each pixel recorded with the second bit width tothe third signal value recorded with the first bit width to obtain thefourth image.
 5. The method according to claim 4, wherein the mapping,based on the third part, different color sub-signal values of each pixelrecorded with the second bit width to the third signal value recordedwith the first bit width to obtain the fourth image comprises:proportionally compressing different color sub-signal values of eachpixel of the third part to a range not exceeding the saturation value ofthe first bit width; and mapping color sub-signal values of pixels,other than the third part, recorded with the second bit width, which aregreater than a color sub-signal value of the saturation value of thefirst bit width, to the saturation value of the first bit width toobtain the fourth image.
 6. The method according to claim 1, whereinboth the third image and the fourth image are images of a red green blue(RGB) space; obtaining the second image based on the third image and thefourth image comprises: converting the third image to an HSV space toobtain a first HSV space image; converting the fourth image to the HSVspace to obtain a second HSV space image; and acquiring correspondingvalues in the RGB space according to a value of a value V channel in thefirst HSV space image, and a value of a hue H channel and a value of asaturation S channel in the second HSV space image, and obtaining thesecond image.
 7. The method according to claim 1, wherein the imageprocessing comprises at least one of: lens shading correction; and whitebalance correction.
 8. A device for image processing, implemented by amobile terminal, the device comprising: a processor; and a memoryconfigured to store instructions executable by the processor, whereinthe processor is configured to acquire a first image output by an imagesensor; responsive to that a first signal value of the first image afterbeing processed exceeds a saturation value of a first bit width at apreset image processing stage, record the first signal value of theprocessed first image as a second signal value with a second bit width,the second bit width being greater than the first bit width; and map thesecond signal value recorded with the second bit width to a third signalvalue recorded with the first bit width to obtain a second image,wherein the processor is further configured to: map, according to amaximum signal value of different color components of each pixel of animage recorded with the first bit width after image processing, thesecond signal value recorded with the second bit width to the thirdsignal value recorded with the first bit width to obtain a third image;map, based on the first image before image processing, different colorsub-signal values of each pixel recorded with the second bit width tothe third signal value recorded with the first bit width to obtain afourth image; and obtain the second image based on the third image andthe fourth image.
 9. The device according to claim 8, wherein theprocessor is further configured to: map a first part, greater than apreset threshold, of the maximum signal value of different colorcomponents of each pixel recorded with the second bit width to a rangebetween the preset threshold and the saturation value of the first bitwidth; and map a second part, less than or equal to the presetthreshold, of the maximum signal value of different color components ofeach pixel recorded with the second bit width to match with a part, lessthan or equal to the preset threshold, of the maximum signal value ofdifferent color components of each pixel of the image recorded with thefirst bit width after image processing to obtain the third image. 10.The device according to claim 8, wherein the processor is furtherconfigured to: obtain a smooth-curve-shape mapping relationship based onthe mapping of the first part to the range between the preset thresholdand the saturation value of the first bit width and the mapping of thesecond part to the part, less than or equal to the preset threshold, ofthe maximum signal value of different color components of each pixel ofthe image recorded with the first bit width after image processing; andmap, according to the smooth-curve-shape mapping relationship, a maximumsignal value of different color components of each pixel recorded withthe second bit width to the third signal value recorded with the firstbit width to obtain the third image.
 11. The device according to claim8, wherein the processor is further configured to: determine, among eachpixel of the first image, a first pixel having different colorsub-signal values all less than the saturation value of the first bitwidth; determine, among each pixel recorded with the second bit width, asecond pixel corresponding to the first pixel; determine, from thesecond pixel, a third part having a color sub-signal value greater thanthe saturation value of the first bit width; and map, based on the thirdpart, different color sub-signal values of each pixel recorded with thesecond bit width to the third signal value recorded with the first bitwidth to obtain the fourth image.
 12. The device according to claim 11,wherein the processor is further configured to: proportionally compressdifferent color sub-signal values of each pixel of the third part to arange not exceeding the saturation value of the first bit width; and mapcolor sub-signal values of pixels, other than the third part, recordedwith the second bit width, which are greater than a color sub-signalvalue of the saturation value of the first bit width, to the saturationvalue of the first bit width to obtain the fourth image.
 13. The deviceaccording to claim 8, wherein the processor is further configured to:convert the third image to an HSV space to obtain a first HSV spaceimage; convert the fourth image to the HSV space to obtain a second HSVspace image; and acquire corresponding values in the RGB space accordingto a value of a value V channel in the first HSV space image, a value ofa hue H channel and a value of a saturation S channel in the second HSVspace image, and obtain the second image.
 14. The device according toclaim 8, wherein the image processing comprises at least one of: lensshading correction; and white balance correction.
 15. A mobile terminal,comprising: a display screen; and the device for image processingaccording to claim
 8. 16. A non-transitory computer-readable storagemedium, having stored instructions therein that, when executed by aprocessor of a mobile terminal, cause the mobile terminal to implementoperations of: acquiring a first image output by an image sensor;responsive to that a first signal value of the first image after beingprocessed exceeds a saturation value of a first bit width at a presetimage processing stage, recording the first signal value of theprocessed first image as a second signal value with a second bit width,the second bit width being greater than the first bit width; and mappingthe second signal value recorded with the second bit width to a thirdsignal value recorded with the first bit width to obtain a second image,wherein mapping the second signal value recorded with the second bitwidth to the third signal value recorded with the first bit width toobtain the second image comprises: mapping, according to a maximumsignal value of different color components of each pixel of an imagerecorded with the first bit width after image processing, the secondsignal value recorded with the second bit width to the third signalvalue recorded with the first bit width to obtain a third image;mapping, based on the first image before image processing, differentcolor sub-signal values of each pixel recorded with the second bit widthto the third signal value recorded with the first bit width to obtain afourth image; and obtaining the second image based on the third imageand the fourth image.
 17. The non-transitory computer-readable storagemedium of claim 16, wherein the mapping, according to a maximum signalvalue of different color components of each pixel of an image recordedwith the first bit width after image processing, the second signal valuerecorded with the second bit width to the third signal value recordedwith the first bit width to obtain a third image comprises: mapping afirst part, greater than a preset threshold, of the maximum signal valueof different color components of each pixel recorded with the second bitwidth to a range between the preset threshold and the saturation valueof the first bit width; and mapping a second part, less than or equal tothe preset threshold, of the maximum signal value of different colorcomponents of each pixel recorded with the second bit width to matchwith a part, less than or equal to the preset threshold, of the maximumsignal value of different color components of each pixel of the imagerecorded with the first bit width after image processing to obtain thethird image.